<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>Hello World!</title>
        <link rel='stylesheet' href='plugins/css/pluginsCss.css' />
        <link rel='stylesheet' href='plugins/plugins.css' />
        <link rel='stylesheet' href='css/luckysheet.css' />
        <link rel='stylesheet' href='assets/iconfont/iconfont.css' />
        <script src="plugins/js/plugin.js"></script>
        <script src="luckysheet.umd.js"></script>
    </head>
    <body>
        <div id="lucky-mask-demo" style="position: absolute;z-index: 1000000;left: 0px;top: 0px;bottom: 0px;right: 0px; background: rgba(255, 255, 255, 0.8); text-align: center;font-size: 40px;align-items:center;justify-content: center;display: none;">Downloading</div>
        <p style="text-align:center;"> 
    
		<div id="luckysheet" style="margin:0px;padding:0px;position:absolute;width:100%;left: 0px;top: 50px;bottom: 0px;outline: none;"></div>
        <script src="luckyexcel.umd.js"></script>
        <!-- <script type="module">
            import l from './luckyexcel.js';
            console.info('=====',l)
            // window.onload = () => {
            //     let upload = document.getElementById("file");
            //     upload.addEventListener("change", function(evt){
            //         var files = evt.target.files;   
            //         importFile(files[0]);
            //     });
            // }
        </script> -->
        <script>
            function demoHandler(){
           
                let mask = document.getElementById("lucky-mask-demo");

                    window.onload = () => {
                            var value = 'kex.xlsx';
                            var name = 'xlsx';
                            if(value==""){
                                return;
                            }
                            mask.style.display = "flex";
                            LuckyExcel.transformExcelToLuckyByUrl(value, name, function(exportJson, luckysheetfile){
                                
                                if(exportJson.sheets==null || exportJson.sheets.length==0){
                                    alert("Failed to read the content of the excel file, currently does not support xls files!");
                                    return;
                                }
                              //  console.log(exportJson, luckysheetfile);
                                mask.style.display = "none";
                                window.luckysheet.destroy();
                                
                                window.luckysheet.create({
                                    container: 'luckysheet', //luckysheet is the container id
									lang: "zh",
                                  allowCopy: true, // 是否允许拷贝
                               showtoolbar: true, // 是否显示工具栏
                               showinfobar: false, // 是否显示顶部信息栏
                               showsheetbar: true, // 是否显示底部sheet页按钮
                               showstatisticBar: true, // 是否显示底部计数栏
                               sheetBottomConfig: false, // sheet页下方的添加行按钮和回到顶部按钮配置
                               allowEdit: true, // 是否允许前台编辑
                               enableAddRow: false, // 允许增加行
                               enableAddCol: false, // 允许增加列
                               userInfo: false, // 右上角的用户信息展示样式
                               showRowBar: true, // 是否显示行号区域
                               showColumnBar: false, // 是否显示列号区域
                               sheetFormulaBar: false, // 是否显示公式栏
                               enableAddBackTop: false,//返回头部按钮
                                
                                    data:exportJson.sheets,
                                    title:exportJson.info.name,
                                    userInfo:exportJson.info.name.creator
                                });
                            });
                       

                    }

            }
            demoHandler();
        </script>
    </body>
</html>